home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / toolfix.arc / TBXFIX < prev   
Text File  |  1987-03-03  |  23KB  |  505 lines

  1. *******************************************************************************
  2.  
  3.                                     TBXFIX
  4.                                   Version 1.2
  5.                                February 9, 1986
  6.                          by Randy Forgaard [70307,521]
  7.  
  8.                              Original version by:
  9.                            Larry Kraft [76703,764]
  10.                            Bela Lubkin [76703,3015]
  11.  
  12.  
  13. This file describes all changes and bug fixes that Borland has made to the
  14. Turbo Database Toolbox (formerly Turbo Toolbox), from the original Version 1.0
  15. of the Toolbox up through Version 1.2, plus some additional fixes that were not
  16. included in Version 1.2.  These changes apply to the Toolbox versions for all
  17. operating systems, except where noted.  The Toolbox is provided in source code
  18. form (except GINST), so you can make these changes directly to the source code
  19. to update your copy of the Toolbox.  Since these are all the known changes, and
  20. the GINST files have been identical in all versions of the Toolbox, it should
  21. not be necessary for you to return your copy of the Toolbox for an updated
  22. copy.  You can perform the "upgrade" yourself.
  23.  
  24.  
  25. Change Log:
  26.  
  27.   Version 1.1: (Also known as Version B.)  Included all changes between Version
  28.                1.00 and Version 1.01/1.1 of the Toolbox.
  29.  
  30.   Version 1.2: Included all additional changes that were made to Version 1.2 of
  31.                the Toolbox, plus some additional fixes.
  32.  
  33. *******************************************************************************
  34.  
  35.  
  36. If you discover any errors or omissions in this file, or if future versions of
  37. the Turbo Database Toolbox incorporate changes not mentioned here, please send
  38. an EasyPlex message to Randy Forgaard [70307,521], or feel free to make the
  39. changes yourself and upload the new version of this file.
  40.  
  41. Between bug fixes and new versions of Turbo Pascal itself, the Turbo Database
  42. Toolbox has had a rather confusing lineage of versions.  However, it has not
  43. substantively changed since its original introduction.  The first version,
  44. introduced in the Fall of 1984, was known as Turbo Toolbox 1.00.  A few bugs
  45. were found and fixed, and a new Version 1.01 appeared in early 1985.
  46.  
  47. Meanwhile, Turbo Pascal 3.0 was released in the Spring of 1985, and with it a
  48. new internal file format for DOS versions of Turbo.  The necessary Turbo
  49. Toolbox modifications, for use with DOS Turbo 3.0, were included on the new DOS
  50. Turbo 3.0 distribution disk under the name ACCESS3.BOX.  This file carried the
  51. moniker of "Version 3.00" in its header, even though the then-current versions
  52. of all other Toolbox files were still identified as Version 1.01.  ACCESS3.BOX
  53. included all of the changes that were made to ACCESS.BOX in Toolbox 1.01, but
  54. anyone who had not updated to 1.01 still had the old versions of the other
  55. *.BOX files.
  56.  
  57. Sometime during 1985, Borland switched to using one digit, instead of two,
  58. after the decimal point in the version numbers for the Toolbox.  Consequently,
  59. Version 1.01 was effectively renamed to Version 1.1, with apparently no change
  60. in content.
  61.  
  62. In late 1985, Borland rewrote the Toolbox manual, and renamed the product to be
  63. Turbo Database Toobox, to distinguish it from the Turbo Graphix Toolbox and
  64. Turbo Editor Toolbox which had since been introduced.  In conjunction with the
  65. new manual and name change, Borland released a new Version 1.2 of the Database
  66. Toolbox.  Version 1.2 differs from 1.01/1.1 in that better error handling was
  67. added in two places, a simpler Turbo Access example program was included (in
  68. addition to the original BTREE program), the user interfaces of the Turbo Sort
  69. example programs were enhanced, and an incorrect fix was made to an outstanding
  70. bug in the DOS edition of Toolbox Version 1.01/1.1.  The original manual (green
  71. and orange) still applies to Version 1.2 of the Toolbox.  The new manual (black
  72. and high-tech) has a nicer design, has more examples, and is generally more
  73. "user-friendly."
  74.  
  75. With Version 1.2 of the Toolbox for DOS, Borland slightly changed its strategy
  76. for handling the two editions of ACCESS.BOX (one for DOS Turbo 2.0, and one for
  77. DOS Turbo 3.0), since Turbo 3.0 is becoming firmly entrenched and the Turbo 2.0
  78. user is a vanishing breed.  Prior to Toolbox 1.2, ACCESS.BOX was for use with
  79. Turbo 2.0, and ACCESS3.BOX was for use with Turbo 3.0.  Now, on the Version 1.2
  80. disk, ACCESS2.BOX is for Turbo 2.0, and ACCESS.BOX is for 3.0.  Borland
  81. provides a batch file on the distribution disk that will rename these files so
  82. that ACCESS2.BOX becomes ACCESS.BOX, for the benefit of Turbo 2.0 users.  In
  83. addition, ACCESS.BOX (formerly ACCESS3.BOX) now carries a Version 1.2 in its
  84. header instead of 3.00, making it consistent with the other Toolbox files.
  85. Unfortunately, ACCESS2.BOX incorrectly says "Version 1.1" in its header, even
  86. though it has been upgraded and placed on the Version 1.2 distribution disk.
  87.  
  88. Wherever your Toolbox version resides in this ancestry, the information below
  89. will tell you how to edit your Toolbox files to make them identical to the most
  90. recent version of the Toolbox, including some fixes that go beyond Version 1.2.
  91.  
  92. Version 1.2 includes a new program, called SETCONST.PAS, that can be very
  93. helpful in choosing values for the constants (MaxDataRecSize, PageSize, etc.)
  94. that Turbo Access requires.  High recommended.  This program is available in
  95. DL 1 of the CompuServe Borland SIG under the name SCONST.PAS.
  96.  
  97. In addition to the BTREE example that was supplied in earlier versions of the
  98. Toolbox, Version 1.2 also includes a new example called TBDEMO.PAS.  TBDEMO is
  99. a simplified version of BTREE: only one IndexFile is used (for customer codes),
  100. and most of the fancy screen handling has been removed.  It is also available
  101. in DL 1 of the Borland SIG, under the same name.
  102.  
  103. In Version 1.2, the example programs SORT1.PAS and SORT2.PAS have a nicer user
  104. interface than in Version 1.0/1.1.  See TBSORT.LBR in DL 1 of the Borland SIG
  105. for a libraried/squeezed version of the new SORT1.PAS, SORT2.PAS, and their
  106. associated data files.  Note: Neither the old version nor the new version of
  107. SORT2.PAS will run correctly under the 8087 or BCD versions of Turbo Pascal (in
  108. particular, the "stock" listing option of SORT2.PAS), because the "Price" field
  109. of ItemRec is a Real field (which occupies more storage under the 8087 and BCD
  110. versions), and the sample data files were created using the normal Turbo
  111. compiler.
  112.  
  113. There are also some other files in DL 1 of the Borland SIG that may be of
  114. interest.  These files describe how to modify the Database Toolbox to extend it
  115. for various purposes; e.g., allowing more than 65535 records per DataFile under
  116. DOS, enabling more than 15 Toolbox files to be open simultaneously under DOS
  117. Turbo 3.0, and automatic "flushing" of DataFiles and IndexFiles under DOS to
  118. guard against file corruption in the event of a system crash.  Try a
  119. "BRO/KEY:TOOLBOX" and a "BRO/KEY:ACCESS" to find these and other files in DL 1.
  120.  
  121. Before making ANY of the changes below, be sure to make a working copy of your
  122. Database Toolbox distribution disk, and make all of these changes to the
  123. working copy ONLY.  These changes are expressed in terms of making changes to
  124. the Database Toolbox disk, for simplicity of exposition, but please be sure
  125. that you are making the changes to your working copy only, and not to the
  126. original Database Toolbox disk.  Important!
  127.  
  128. The changes below are numbered.  None of the versions of the Toolbox requires
  129. all of these changes; different versions require different changes.  For the
  130. purposes of the instructions below, determine which version of the Toolbox you
  131. have by looking at the header comment at the beginning of ADDKEY.BOX on your
  132. distribution disk.  Using that version number, use the following table to
  133. determine which of the 20 changes below you need to make.
  134.  
  135. Toolbox Version #     Operating System     Which Changes to Make
  136. -----------------     ----------------     ---------------------
  137. 1.00                  CP/M-80, CP/M-86     3, 6-12, 15-20
  138. 1.00                  MS-DOS, PC-DOS       1-12, 14-20
  139. 1.01, 1.1             CP/M-80, CP/M-86     3, 6-8, 11-12, 18
  140. 1.01, 1.1             MS-DOS, PC-DOS       1-8, 11-12, 14, 18
  141. 1.2                   CP/M-80, CP/M-86     18
  142. 1.2                   MS-DOS, PC-DOS       5, 13-14, 18
  143.  
  144. IMPORTANT: If you have a pre-1.2 version of the Toolbox for DOS, it is
  145. essential that you really do the file renaming described in Change #1, below,
  146. BEFORE performing the other changes.  Otherwise, when you make the other
  147. changes, you will be modifying the wrong ACCESS.BOX file!
  148.  
  149.  
  150.  
  151. CHANGE #1 (Toolbox Versions 1.00, 1.01, and 1.1, DOS only):
  152.  
  153. If you are using some version of DOS Turbo 3.0: 1) Copy ACCESS3.BOX from the
  154. Turbo Pascal 3.0 distribution disk to your Toolbox disk.  2) On the Toolbox
  155. disk, rename the file ACCESS.BOX to ACCESS2.BOX.  3) Also on the Toolbox disk,
  156. rename ACCESS3.BOX to ACCESS.BOX.
  157.  
  158. If you are using DOS but do not have Turbo 3.0, ignore all changes below for
  159. ACCESS.BOX.  Instead, for all changes indicated below for ACCESS2.BOX, make
  160. >those< changes to your ACCESS.BOX file.
  161.  
  162.  
  163.  
  164. CHANGE #2 (Toolbox Versions 1.00, 1.01, and 1.1, DOS only):
  165.  
  166. The DOS edition of Version 1.2 of the Toolbox supplies a new batch file, called
  167. TURBO2.BAT.  This batch file contains many ECHO and PAUSE statements that
  168. provide warnings against running the batch file unless you are sure.  The only
  169. executable DOS commands in TURBO2.BAT are the following:
  170.  
  171.   ren access.box access3.box
  172.   ren access2.box access.box
  173.  
  174. You may want to create TURBO2.BAT, with the above lines, for future reference,
  175. if you have a pre-1.2 DOS version of the Toolbox.  However, you should ONLY
  176. actually run TURBO2.BAT if you will be using Turbo 2.0 instead of Turbo 3.0
  177. with the Toolbox.
  178.  
  179.  
  180.  
  181. CHANGE #3 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
  182.  
  183. Replace the header in each of ADDKEY.BOX, GETKEY.BOX, and DELKEY.BOX with the
  184. following.  (Replace "ADDKEY," below, with "GETKEY" or "DELKEY" as appropriate.
  185. Also, replace "MS-DOS, PC-DOS" with "CP/M-80" or "CP/M-86," if appropriate.)
  186. In addition, if you have a CP/M-80 or CP/M-86 version of the Toolbox, make this
  187. same header replacement in ACCESS.BOX (with appropriate substitutions for
  188. "ADDKEY" and the operating system).
  189.  
  190. (*********************************************************)
  191. (*                                                       *)
  192. (*           TURBO-ACCESS for MS-DOS, PC-DOS             *)
  193. (*                                                       *)
  194. (*               Toolbox version:   1.2                  *)
  195. (*                                                       *)
  196. (*                   ADDKEY module                       *)
  197. (*                                                       *)
  198. (*          Use with TURBO PASCAL 2.0 or later           *)
  199. (*                                                       *)
  200. (*              Copyright (C) 1984,85 by                 *)
  201. (*               Borland International                   *)
  202. (*                                                       *)
  203. (*********************************************************)
  204.  
  205.  
  206.  
  207. CHANGE #4 (Toolbox Versions 1.00, 1.01, and 1.1, DOS only):
  208.  
  209. Replace the header in ACCESS.BOX with the following (the "IMPORTANT:" message
  210. below is part of the header in the file):
  211.  
  212. (*********************************************************)
  213. (*                                                       *)
  214. (*           TURBO-ACCESS for MS-DOS, PC-DOS             *)
  215. (*                                                       *)
  216. (*               Toolbox version:   1.2                  *)
  217. (*                                                       *)
  218. (*                   ACCESS module                       *)
  219. (*                                                       *)
  220. (*          Use with TURBO PASCAL 3.0 or later           *)
  221. (*                                                       *)
  222. (*              Copyright (C) 1984,85 by                 *)
  223. (*               Borland International                   *)
  224. (*                                                       *)
  225. (*********************************************************)
  226. (*
  227.     IMPORTANT:
  228.  
  229.       Use this file, ACCESS.BOX, when compiling with TURBO 3.0.
  230.       Use ACCESS2.BOX when compiling with TURBO 2.0.
  231. *)
  232.  
  233.  
  234.  
  235. CHANGE #5 (all Toolbox versions, DOS only):
  236.  
  237. Replace the header in ACCESS2.BOX with the following.  Note: The header in
  238. ACCESS2.BOX on the distribution disk for Toolbox Version 1.2 is out-of-date.
  239. It reports the Toolbox version number as 1.1 instead of 1.2, includes a "Module
  240. version" number that has since been discarded, and omits the "IMPORTANT:" line
  241. at the end of the header.  These lines have been corrected, below.
  242.  
  243. (*********************************************************)
  244. (*                                                       *)
  245. (*           TURBO-ACCESS for MS-DOS, PC-DOS             *)
  246. (*                                                       *)
  247. (*               Toolbox version:   1.2                  *)
  248. (*                                                       *)
  249. (*                   ACCESS module                       *)
  250. (*                                                       *)
  251. (*           Use with TURBO PASCAL 2.0 only              *)
  252. (*                                                       *)
  253. (*              Copyright (C) 1984,85 by                 *)
  254. (*               Borland International                   *)
  255. (*                                                       *)
  256. (*********************************************************)
  257. (*
  258.     IMPORTANT:
  259.  
  260.     Use this file, ACCESS2.BOX, when compiling with TURBO 2.0.
  261.     Use ACCESS.BOX when compiling with TURBO 3.0.
  262. *)
  263.  
  264.  
  265.  
  266. CHANGE #6 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
  267.  
  268. Replace the header in BTREE.PAS with the following:
  269.  
  270. (****************************************************************)
  271. (*                                                              *)
  272. (*                  TURBO-ACCESS Database Example               *)
  273. (*                      MODIFIED: 10/02/85                      *)
  274. (*                                                              *)
  275. (*                  Copyright (C) 1984, 1985 by                 *)
  276. (*                    Borland International                     *)
  277. (*                                                              *)
  278. (****************************************************************)
  279.  
  280.  
  281.  
  282. CHANGE #7 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
  283.  
  284. Add the following header to the beginning of BTREE.INC:
  285.  
  286. (****************************************************************)
  287. (*                                                              *)
  288. (*                  TURBO-ACCESS Database Example               *)
  289. (*                      MODIFIED: 10/02/85                      *)
  290. (*                                                              *)
  291. (*                      - Include module -                      *)
  292. (*                                                              *)
  293. (*                  Copyright (C) 1984, 1985 by                 *)
  294. (*                    Borland International                     *)
  295. (*                                                              *)
  296. (****************************************************************)
  297.  
  298.  
  299.  
  300. CHANGE #8 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
  301.  
  302. Add the following header to the beginning of SORT.BOX:
  303.  
  304.       (***********************************************************)
  305.       (*                                                         *)
  306.       (*                 TURBO DATABASE TOOLBOX                  *)
  307.       (*                                                         *)
  308.       (*                    QuickSort module                     *)
  309.       (*                      Version 1.2                        *)
  310.       (*                                                         *)
  311.       (*                 Copyright (C) 1984,85 by                *)
  312.       (*                  Borland International                  *)
  313.       (*                                                         *)
  314.       (***********************************************************)
  315.  
  316.  
  317.  
  318. CHANGE #9 (Toolbox Version 1.00, all operating systems):
  319.  
  320. In ACCESS2.BOX, add the following line immediately after the "PutRec(...);"
  321. statement in procedure CloseIndex:
  322.  
  323.           Updated := false;
  324.  
  325.  
  326.  
  327. CHANGE #10 (Toolbox Version 1.00, all operating systems):
  328.  
  329. In ACCESS2.BOX, add the following two lines in two different places:
  330. immediately after the "Assign(...);" statement in procedure MakeFile, and also
  331. immediately after the "Assign(...);" statement in procedure OpenFile.
  332.  
  333.           IOstatus := IOresult;
  334.           TaIOcheck(DatF,0);
  335.  
  336.  
  337.  
  338. CHANGE #11 (Toolbox Versions 1.00, 1.01, 1.1, all operating systems):
  339.  
  340. In ACCESS2.BOX, add the following two lines in two different places:
  341. immediately after the "Seek(...);" statement in procedure GetRec, and also
  342. immediately after the "Seek(...);" statement in procedure PutRec.  (Note: These
  343. two lines are NOT exactly the same as the additional lines specified in Change
  344. #10!)
  345.  
  346.           IOstatus := IOresult;
  347.           TaIOcheck(DatF,R);
  348.  
  349.  
  350.  
  351. CHANGE #12 (Toolbox Versions 1.00, 1.01, 1.1, all operating systems):
  352.  
  353. Use Change #11 (only), above, to modify ACCESS.BOX in exactly the same manner
  354. as ACCESS2.BOX.
  355.  
  356.  
  357.  
  358. CHANGE #13 (Toolbox Version 1.2 ONLY, DOS only):
  359.  
  360. In ACCESS.BOX for DOS Toolbox Version 1.2, the declaration of the "Fil2" field
  361. of the DataFile type appears as:
  362.  
  363.           Fil2       : array[0..12] of Byte;
  364.  
  365. Replace this line with:
  366.  
  367.           Fil2       : array[1..12] of Byte;
  368.  
  369. (Note: This error does not appear in pre-1.2 versions of the DOS Toolbox.)
  370.  
  371.  
  372.  
  373. CHANGE #14 (all Toolbox versions, DOS only):
  374.  
  375. In ACCESS.BOX, in the TaIOcheck procedure, change the statement:
  376.  
  377.           I := 0;
  378. to:
  379.           I := 1;
  380.  
  381.  
  382.  
  383. CHANGE #15 (Toolbox Version 1.00, all operating systems):
  384.  
  385. In ADDKEY.BOX, in the very last three lines of the file, change:
  386.  
  387.               end;
  388.             end;
  389.           end;
  390. to:
  391.               end;
  392.               PP := 0;
  393.             end;
  394.           end;
  395.  
  396.  
  397.  
  398. CHANGE #16 (Toolbox Version 1.00, all operating systems):
  399.  
  400. In DELKEY.BOX, in the very last four lines of the file, change:
  401.  
  402.                 end;
  403.               end;
  404.             end;
  405.           end;
  406. to:
  407.                 end;
  408.               end;
  409.               PP := 0;
  410.             end;
  411.           end;
  412.  
  413.  
  414.  
  415. CHANGE #17 (Toolbox Version 1.00, all operating systems):
  416.  
  417. In SORT.BOX, about 17 lines after the main BEGIN of procedure QuickSort,
  418. change:
  419.           M:=(I+J) Div 2;
  420. to:
  421.           M:=(I+J) Shr 1;
  422.  
  423. (Note: This is not just for efficiency.  The old "Div 2" version can cause an
  424. arithmetic run-time error when sorting large files.)
  425.  
  426.  
  427.  
  428. CHANGE #18 (all Toolbox versions, all operating systems):
  429.  
  430. (Thanks to Scott Bussinger [72247,2671] for this fix.)  When duplicate keys are
  431. allowed in an IndexFile, the Toolbox manual states that routines such as
  432. FindKey locate the first entry in the IndexFile having that key.  However, this
  433. is not necessarily true if there are more than 32767 records in the associated
  434. DataFile.  Due to a bug in the TaCompKeys function of ACCESS.BOX and
  435. ACCESS2.BOX, having to do with signed vs. unsigned arithmetic, FindKey will
  436. locate the >second< of two key entries having the same key, if the DataRef of
  437. the first key is less than or equal to 32767, and the DataRef of the second key
  438. is greater than 32767.
  439.  
  440. This does not have a great deal of practical significance.  FindKey (and the
  441. rest of the Toolbox) will all work consistently with the current version of
  442. TaCompKeys; i.e., IndexFile entries having the same key will always be found
  443. and returned in the same order, even though that order may not proceed in the
  444. order that the associated data records are physically stored in the DataFile.
  445. The physical order in the DataFile is usually not important, however.  For
  446. example, if you delete a record using DeleteRec near the beginning of a
  447. DataFile, and later add a record with AddRec, AddRec will reuse that deleted
  448. record location before adding new records to the end of the DataFile.
  449.  
  450. Another caveat: If you do fix the TaCompKeys bug, you will need to reconstruct
  451. all of your already-existing IndexFiles that allow duplicate keys before
  452. attempting to access the IndexFiles with your applications, to institute the
  453. new notion of TaCompKeys consistency into the IndexFiles.  If you do not
  454. reconstruct your IndexFiles after fixing TaCompKeys, bizarre errors will result
  455. at run-time.
  456.  
  457. Taking the above into account, if you decide to correct the TaCompKeys bug,
  458. replace the ENTIRE body of TaCompKeys (but keep the variable declarations), in
  459. both ACCESS.BOX and ACCESS2.BOX, with the following code:
  460.  
  461.         begin
  462.           if Key1 = Key2 then
  463.             if (not Dup) or (DR1 = DR2) then TaCompKeys := 0
  464.             else if (DR1 + $8000) > (DR2 + $8000) then TaCompKeys := 1
  465.             else TaCompKeys := -1
  466.           else if Key1 > Key2 then TaCompKeys := 1
  467.           else TaCompKeys := -1
  468.         end;
  469.  
  470.  
  471.  
  472. CHANGE #19 (Toolbox Version 1.00, all operating systems):
  473.  
  474. The TurboSort function should not be used as a parameter to a WRITE or WRITELN
  475. statement, as this may result in an illegal recursive call to READ or WRITE.
  476. This is the reason behind both this change and Change #20.  Add the following
  477. variable declaration to the main VAR section of both SORT1.PAS and SORT2.PAS on
  478. the Toolbox disk, and also on pages 71, 75, 78, and 82 of the original (green
  479. and orange) Turbo Toolbox manual (if you have it).
  480.  
  481.           Results : integer;
  482.  
  483.  
  484.  
  485. CHANGE #20 (Toolbox Version 1.00, all operating systems):
  486.  
  487. (See Change #19.)  Throughout SORT1.PAS and SORT2.PAS, replace each occurrence
  488. of the following line:
  489.  
  490.           WriteLn(TurboSort(SizeOf(CustRec)));
  491.  
  492. with the following TWO lines:
  493.  
  494.           Results:=TurboSort(SizeOf(CustRec));
  495.           WriteLn(Results);
  496.  
  497. There will be one occurrence of the above in SORT1.PAS, and two occurrences in
  498. SORT2.PAS.  Make this same change to pages 74, 76, 78 (two occurrences), and 84
  499. (two occurrences) of the original (green and orange) Turbo Toolbox manual (if
  500. you have it).
  501.  
  502.  
  503.  
  504. That's all!